package com.atguigu.controller;

import com.atguigu.model.system.SysRole;
import com.atguigu.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("admin/system/sysRole")
public class SysRoleController {
    //http://localhost:8800/admin/system/sysRole/findAll
    //注入service
    @Autowired
    private SysRoleService sysRoleService;

    //查询所有角色
    @GetMapping("findAll")
    public List<SysRole> findAll(){

        List<SysRole> rolelist = sysRoleService.list();
        return rolelist;
    }

}
